package com.liyunc.toolset;

/**
 * Copyright (c) 2018-2023 ThunderSoft
 * All Rights Reserved by Thunder Software Technology Co., Ltd and its affiliates.
 * You may not use, copy, distribute, modify, transmit in any form this file
 * except in compliance with ThunderSoft in writing by applicable law.
 */

import java.util.Arrays;

/**
 * @author liyuncong
 * @version 1.0
 * @file WorkMode
 * @brief WorkMode
 * @details WorkMode
 * @date 2023-02-15
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-02-15                  liyuncong          Created
 */
public enum WorkMode {

    QUERY_PROCESS("process-query"),
    KILL_PROCESS("process-kill");

    private final String name;

    WorkMode(String name) {
        this.name = name;
    }

    public static WorkMode forName(String name) {
        return Arrays.stream(WorkMode.values())
            .filter(item -> item.getName().equalsIgnoreCase(name))
            .findAny()
            .orElse(null);
    }

    public String getName() {
        return name;
    }
}
